package demo.condition;

import demo.condition.dao.MyDao;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class TestMain {
    public static void test1()
    {
        ApplicationContext context=new AnnotationConfigApplicationContext(MyDao.class);
        if(context.containsBean("dao"))
        {
            MyDao dao=(MyDao)context.getBean("dao");    
            dao.insert();
        }
        else
        {
            System.out.println("没有找到名为dao的Bean");
        }
    }

    public static void main(String[] args)
    {
        test1();
    }
    
}
